import 'package:flutter/material.dart';

class Message extends StatelessWidget {
  final int count;

  const Message({Key key, this.count}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(right: 5, top: 10, bottom: 10),
      child: Container(
        child: Stack(
          children: <Widget>[
            Align(
              child: Container(
                  width: 25,
                  height: 25,
                  decoration: BoxDecoration(
                      color: Colors.black26,
                      borderRadius: BorderRadius.circular(20)),
                  child: Icon(
                    Icons.more_horiz,
                    size: 20,
                  )),
              alignment: Alignment.center,
            ),
            Positioned(
              top: 0,
              left: 0,
              right: 0,
              child: Container(
                decoration: BoxDecoration(
                    color: Colors.red, borderRadius: BorderRadius.circular(5)),
                child: Padding(
                  padding: const EdgeInsets.all(2.0),
                  child: Center(
                    child: Text(
                      this.count.toString(),
                      style: TextStyle(fontSize: 9),
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
